<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr = [1, 2, 3, 4, 5, 6, 88, 8888]
        // for(let item of arr){
        //     console.log(item);
        // }
        // for (let key of arr.keys()) {
        //     //打印索引值
        //     console.log(key);
        // }
        // for (let item of arr.values()) {
        //     //打印数组中的每一项
        //     console.log(item);
        // }
        for (let [key, item] of arr.entries()) {
            //打印数组中的索引值以及每一项
            console.log(key, item);
        }
    </script>
</body>

</html>